<template>
    <div class="PersonalCenter">
      <div class="PersonalCenter_top">
        <p>个人中心</p>
        <div class="personalDetails">
          <div class="image">
            <img src="../../assets/1557047684829.jpeg" alt="">
          </div>
          <button @click="login">登录/注册</button>
        </div>
      </div>
     <div class="PersonalCenter_center">
       <div class="warp"
            v-for="(item,key) in list" :key = key
       >
         <div class="interest"
              v-for="(val, index) in item"
              :key = index
              @click="address(val.slot)"
         >
           <div class="span">
             <img :src='item[index].img' alt="0">
           </div>
           <div class="p">{{item[index].title}}</div>
         </div>
       </div>
       <div class="youLike">
         <div class="wire"></div><p>猜你喜欢</p><div class="wire"></div>
       </div>
       <div class="PersonalCenter-bottom">

         <div class="LikeList" v-for="(value,key) in [1,2]" :key = key>
           <div class="img">
             <div class="suggests"></div>
           </div>
           <div class="title">
             {{value}}【拼品牌】 太太乐软毛扫把簸箕套装扫地鉊
           </div>
         </div>
       </div>
     </div>
      <router-view></router-view>
    </div>
</template>

<script>
    export default {
        name: "PersonalCenter",
      data(){
          return{
            list:[
              [{title:'我的关注', img:0}, {title:'签到礼金', img:0}, {title:'优惠券', img:0}],
              [{title:'代付款',img:require('../../assets/daifukuan.png')},
                {title:'代收货',img:require('../../assets/icon-daishouhuo.png')},
                {title:'已完成',img:require('../../assets/yiwancheng.png')},
                {title:'全部订单',img:require('../../assets/quanbudingdan.png')}
              ],
              [{title:'砍价团',img:require('../../assets/155745633201413553.png')},
                {title:'新人红包',img:require('../../assets/155745620576685615.png')},
                {title:'一元邀新',img:require('../../assets/155745620576685615.png')},
                {title:'收货地址',img:require('../../assets/155745620576685615.png'),slot:'/myCommodity/site'}
              ]],
          }
      },
      methods:{
        login(){
          this.$router.push({path:'./login'})
        },
        address(path){
          this.$router.push({
            path:path
          })
        }
      },
      mounted() {
        console.log(this.list[0]);
      }
    }
</script>

<style scoped lang="scss">
  button{
    padding: 0;
  }
  .PersonalCenter{
   width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    overflow: auto;
    .PersonalCenter_top{
      height: 545px;
      background: #eb4f3f;
      padding:60px 40px 100px;
      box-sizing: border-box;
      p{
        line-height: 120px;
        margin: 0;
        text-align: center;
        color: white;
        font-size: 60px;
      }
      .personalDetails{
        width: 100%;
        line-height: 265px;
        .image{
          width: 180px;
          height: 180px;
          display: inline-block;
          border-radius: 50%;
          vertical-align: middle;
          padding: 10px;
          img{
            width: 100%;
            height: 100%;
            border-radius: 50%;
            margin: 10px;
            box-sizing: border-box;
          }
        }
        button{
          vertical-align: middle;
          margin-left: 75px;
          width: 260px;
          display: inline-block;
          border-radius: 35px;
          line-height: 70px;
          font-size: 30px;
          background: #eb4f3f;
          border: solid 1px white;
          color: white;
          outline: none;
        }
      }
    }
    .PersonalCenter_center{
      width: 100vw;
      position: absolute;
      top: 440px;
      height: 100vh;
      padding: 0 40px;
      box-sizing: border-box;
      .warp{
        width: 1160px;
        height: 260px;
        box-sizing: border-box;
        border-radius: 40px;
        background: white;
        margin-bottom: 40px;
        display: flex;
        .interest{
          flex: 1;
          text-align: center;
          .span{
            font-size: 45px;
            padding-top: 28px;
            height: 155px;
            line-height: 155px;
            color: #333;
            img{
              width: 95px;
              height: 75px;
            }
          }
          .p{
            height: 70px;
            color: #666666;
            font-size: 36px;
            margin: 0;
          }
        }
      }
      .warp:nth-child(1) .span img{

       }
      .warp:nth-child(3){
        .span{
          img{
            width: 120px;
            height: 120px;
          }
        }
      }
      .youLike{
        width: 930px;
        margin: 10px auto;
        height: 90px;
        display: flex;
        .wire{
          width: 332px;
          height: 5px;
          background: #dddddd;
          margin: 30px 0;
          font-size: 43px;
        }
        p{
          flex: 1;
          text-align: center;
          width: 950px;
          margin: 0;
        }
      }
    }
    .PersonalCenter-bottom{
      width: 1160px;
      height: 850px;
      display: flex;
      box-sizing: border-box;
      .LikeList{
        flex: 1;
        width: 570px;
        height: 840px;
        background: white;
        margin-right: 15px;
        border-radius: 40px;
        box-sizing: border-box;
        padding: 40px;
        .img{
          width: 100%;
          height: 490px;
          background: orangered;
          border-radius: 35px;
          position: relative;
          .suggests{
            width: 357px;
            height: 56px;
            background: #c39490;
            position: absolute;
            bottom: -30px;
            left: 0;
          }
        }
        .title{
          height: 160px;
          padding: 38px 0;
        }
      }
    }
  }
</style>
